package org.charles.zhifou.model.dto.app;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import lombok.Data;
import org.charles.zhifou.common.enums.CodeToEnumDeserializer;
import org.charles.zhifou.enums.*;

import java.io.Serial;
import java.io.Serializable;

/**
 * 查询应用请求
 *
 * @author Charles
 * @version 1.0
 */
@Data
public class AppQueryRequest implements Serializable {

    @Schema(description = "id")
    @Min(value = 1, message = "id 必须大于 0")
    private Long id;

    @Schema(description = "应用名")
    private String appName;

    @Schema(description = "应用描述")
    private String appDesc;

    @Schema(description = "应用图标")
    private String appIcon;

    @Schema(description = "应用类型（0-得分类，1-测评类）")
    @JsonDeserialize(using = CodeToEnumDeserializer.class)
    private AppTypeEnum appType;

    @Schema(description = "评分策略（0-自定义，1-AI）")
    @JsonDeserialize(using = CodeToEnumDeserializer.class)
    private ScoringStrategyEnum scoringStrategy;

    @Schema(description = "审核状态：0-待审核, 1-通过, 2-拒绝")
    @JsonDeserialize(using = CodeToEnumDeserializer.class)
    private ReviewStatusEnum reviewStatus;

    @Schema(description = "审核信息")
    private String reviewMessage;

    @Schema(description = "审核人 id")
    private Long reviewerId;

    @Schema(description = "创建用户 id")
    private Long userId;

    @Schema(description = "not id")
    private Long notId;

    @Schema(description = "搜索词")
    private String searchText;

    @Schema(description = "当前页号")
    @Min(value = 1, message = "当前页号必须大于 0")
    private int current = 1;

    @Schema(description = "页面大小")
    @Min(value = 1, message = "页面大小必须大于 0")
    private int pageSize = 10;

    @Schema(description = "排序字段")
    private String sortField;

    @Schema(description = "排序顺序 (默认升序)")
    @JsonDeserialize(using = CodeToEnumDeserializer.class)
    private SqlSortOrderEnum sortOrder = SqlSortOrderEnum.ASC;

    @Serial
    private static final long serialVersionUID = 1L;
}